<?php

// $Id$

require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class CI_Type_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_name = $form->get_field('name');
		$f_name_view = new Form_Field_Text_View($form->get_name().'_'.$f_name->get_name(), $f_name);
		$this->add_field_view('name', $f_name_view);

		$f_hid = $form->get_field('hid');
		$f_hid_view = new Form_Field_Text_View($form->get_name().'_'.$f_hid->get_name(), $f_hid);
		$this->add_field_view('hid', $f_hid_view);

		$f_page_edit_path = $form->get_field('page_edit_path');
		$f_page_edit_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_page_edit_path->get_name(), $f_page_edit_path);
		$this->add_field_view('page_edit_path', $f_page_edit_path_view);

		$f_page_manage_path = $form->get_field('page_manage_path');
		$f_page_manage_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_page_manage_path->get_name(), $f_page_manage_path);
		$this->add_field_view('page_manage_path', $f_page_manage_path_view);

		$f_page_select_path = $form->get_field('page_select_path');
		$f_page_select_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_page_select_path->get_name(), $f_page_select_path);
		$this->add_field_view('page_select_path', $f_page_select_path_view);

		$f_page_delete_path = $form->get_field('page_delete_path');
		$f_page_delete_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_page_delete_path->get_name(), $f_page_delete_path);
		$this->add_field_view('page_delete_path', $f_page_delete_path_view);
		$f_page_preview_path = $form->get_field('page_preview_path');
		$f_page_preview_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_page_preview_path->get_name(), $f_page_preview_path);
		$this->add_field_view('page_preview_path', $f_page_preview_path_view);

		$f_class_path = $form->get_field('class_path');
		$f_class_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_class_path->get_name(), $f_class_path);
		$this->add_field_view('class_path', $f_class_path_view);

		$f_class_name = $form->get_field('class_name');
		$f_class_name_view = new Form_Field_Text_View($form->get_name().'_'.$f_class_name->get_name(), $f_class_name);
		$this->add_field_view('class_name', $f_class_name_view);

		$f_capture_prefix = $form->get_field('capture_prefix');
		$f_capture_prefix_view = new Form_Field_Text_View($form->get_name().'_'.$f_capture_prefix->get_name(), $f_capture_prefix);
		$this->add_field_view('capture_prefix', $f_capture_prefix_view);

		$f_db_table = $form->get_field('db_table');
		$f_db_table_view = new Form_Field_Text_View($form->get_name().'_'.$f_db_table->get_name(), $f_db_table);
		$this->add_field_view('db_table', $f_db_table_view);

		$f_allow_images = $form->get_field('allow_images');
		$f_allow_images_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_allow_images->get_name(), $f_allow_images);
		$this->add_field_view('allow_images', $f_allow_images_view);

		$f_allow_attachments = $form->get_field('allow_attachments');
		$f_allow_attachments_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_allow_attachments->get_name(), $f_allow_attachments);
		$this->add_field_view('allow_attachments', $f_allow_attachments_view);
	}
}